#include "log/log.h"
#include "app_message.h"
#include <stdlib.h>


int main(int argc, char *argv[]) 
{
    char *json_message = 
        "{\"conn_type\":1,\"id\":\"5858\",\"msg\":\"61626364\"}";

    char chars_buff[100];
    //json消息转换为字符数组
    int charsLen = app_message_json2Chars(json_message,chars_buff, 100);
    log_debug("字符数组消息为%.*s,长度为%d", charsLen, chars_buff, charsLen);

    //字符数组转换为json消息
    char *json_message2 = app_message_chars2Json(chars_buff, charsLen);
    log_debug("json消息为%s",json_message2);

    free(json_message2);

    return 0;

}